#!/usr/bin/bash

WINRAR="/E/Program Files/WinRAR/WinRAR.exe"


WINRARDIR=`dirname.exe "$WINRAR"`
REALPATH=`realpath.exe "$0"`
DIR=`dirname.exe "$REALPATH"`

PATH=$PATH:$WINRARDIR

# ==============================================================
cd "$DIR"

candle.exe "Sins Map Pack Editor.wxs"        -out obj/
light.exe  "obj/Sins Map Pack Editor.wixobj" -out "bin/Setup.msi"

cd "$DIR/bin"
MSBuild.exe /target:Bootstrapper "../Sins Map Pack Editor.proj"

WinRAR.exe a -sfx -z"../Sins Map Pack Editor.sfx" -iicon"../Sins Map Packer.ico" "Sins Map Pack Editor.exe" Setup.msi setup.exe ../setup.bat

# ==============================================================
cd "$DIR"
candle.exe "Sins Map Pack Installer.wxs"        -out obj/
light.exe  "obj/Sins Map Pack Installer.wixobj" -out "bin/Setup.msi"

cd "$DIR/bin"
MSBuild.exe /target:Bootstrapper "../Sins Map Pack Installer.proj"

WinRAR.exe a -sfx -z"../Sins Map Pack Installer.sfx" -iicon"../Sins Map Packer.ico" "Sins Map Pack Installer.exe" Setup.msi setup.exe ../setup.bat
